package com.gxa.saas.core.entity.vo.luoj;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 订单表
 * </p>
 *
 * @author wu
 * @since 2022-07-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Validated
@TableName("tb_order")
public class OrderCartVO implements Serializable {

    private static final long serialVersionUID=1L;

    /**
     * 订单id，主键
     */
      @TableId(value = "od_id", type = IdType.ASSIGN_ID)
    private Integer odId;

    /**
     * 商品名
     */
    @NotEmpty(message = "商品名不能为null")
    private String comName;

    /**
     * 订单商品数量
     */
    private Integer comNum;

    /**
     * 订单金额
     */
    private BigDecimal odPrice;

    /**
     * 订单生成时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using= LocalDateTimeDeserializer.class)
    private LocalDateTime odTime;

    /**
     * 订单编号
     */
    private Long odNumber;

    /**
     * 店铺Id
     */
    @NotEmpty(message = "店铺Id不能为null")
    private String odShopId;


    /**
     * 订单状态：默认为0(待付款)、1(待发货)、2(待收获)、3(已完成)
     */
    private Integer odStatus;

    /**
     * 用户Id
     */
    private Integer userId;

    /**
     * 财务审核状态
     */
    private Integer mStatus;

    /**
     * 收货地址
     */
    private String shAddress;

    /**
     * 收货人名
     */
    private String shName;

    /**
     * 收货号码
     */
    private Long shPhone;


}
